import { createApp } from 'vue'
// 引入路由
import router from './router/index'
// 引入路由守卫
import '@/router/permission'
// 引入pinia
import pinia from '@/store'
// 引入socket
import socket from '@/socket'
// 监听socket事件
import '@/socket/listen-socket'
// 引入图标
import { registerIcon } from '@/assets/icon'
// 重置样式
import './style/reset.scss'
// 引入主题
import './style/theme'
import './style/theme.scss'

// 本地缓存保存到Pinia
import '@/utils/saveStoreInfo'

// 引入element-plus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import App from './App.vue'

const app = createApp(App)
app.config.globalProperties.$baseUrl = import.meta.env.VITE_APP_API_BASEURL
app.config.globalProperties.socket = socket
app.use(router)
app.use(pinia)
app.use(ElementPlus, {
	locale: zhCn
})
registerIcon(app)
app.mount('#app')
